var path = require('path')

var base = path.resolve(__dirname, '../logs')
var parttern = 'yyyy-MM-dd.log'
module.exports = {
  'appenders': {
    'access': {
      'type': 'dateFile',
      'filename': base + '/access-',
      'pattern': parttern
    },
    'rule-console': {
      'type': 'console'
    },
    'rule-file': {
      'type': 'dateFile',
      'filename': base + '/server-',
      'encoding': 'utf-8',
      'maxLogSize': 10000000,
      'numBackups': 3,
      'pattern': parttern,
      'alwaysIncludePattern': true
    },
    'rule-error': {
      'type': 'dateFile',
      'filename': base + '/error-',
      'encoding': 'utf-8',
      'maxLogSize': 1000000,
      'numBackups': 3,
      'pattern': parttern,
      'alwaysIncludePattern': true
    }
  },
  'categories': {
    'default': {
      'appenders': [
        'rule-console',
        'rule-file',
        'rule-error'
      ],
      'level': 'debug'
    },
    'http': {
      'appenders': [
        'access'
      ],
      'level': 'info'
    }
  }
}
